<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
    <title>订单支付</title>
    <link rel="stylesheet" th:href="@{/css/commons.css}"/>
    <script type="text/javascript" th:src="@{/js/jquery-3.6.0.min.js}"></script>
    <script type="text/javascript">
        $(function () {
            let time = [[${timer}]];
            let timeId = setInterval(() => {
                if (time === 0) {
                    clearInterval(timeId);
                }
                $("#time").text(time--);
            }, 1000);
        });
    </script>
</head>
<body>

<!--/*@thymesVar id="order" type="com.richie696.rabbit.order.domain.OrderInfo"*/-->
<form action="/order/payment_exec" method="post">
    <div>
        <span>商品名称：</span><span th:text="${order.name}"></span>
    </div>
    <div>
        <span>支付金额：</span><span th:text="${order.price}"></span>
    </div>
    <div>
        <span>购买数量：</span><span th:text="${order.count}"></span>
    </div>
    <div>
        <span>用户 ID：</span><span th:text="${order.userId}"></span>
    </div>
    <div>
        <span>支付倒计时：</span><span id="time">15</span>
    </div>
    <div>
        <button type="submit">立即支付</button>
    </div>
    <input type="hidden" name="uid" th:value="${order.userId}"/>
    <input type="hidden" name="oid" th:value="${order.orderId}"/>
</form>

</body>
</html>
